flushClass($("#class"));

function selectClass() {
    var json={"classid":$("#class").val(),"page":1}

    $.get("http://139.199.200.112/dtpr/index.php?exam-teach-users-classrank",json,function (data) {
        data=JSON.parse(data).data.data;

        console.log(data);
        $("#first").empty();
        $("#second").empty();
        $("#third").empty();

        if(data[0]!==undefined){
            $("#first").html(data[0].name);
        }

        if(data[1]!==undefined){
            $("#second").html(data[1].name);
        }

        if(data[2]!==undefined){
            $("#third").html(data[2].name);
        }
    });

    flushTable("http://139.199.200.112/dtpr/index.php?exam-teach-users-classrank",JSON.stringify(json),"#page",".table tbody");
}

function addLine(data) {
    var parent=$(".table tbody");
    parent.append("<tr>" +
        "<td>"+data.allqueue+"</td>\n" +
        "<td>"+data.classqueue+"</td>\n" +
        "<td>"+data.name+"</td>\n" +
        "<td>"+data.rate+"</td>\n" +
        "<td>"+data.finished+"</td>" +
        "</tr>");
}